/* 
 * File:   Reader.h
 * Author: Elevator
 *
 * Created on July 24, 2013, 8:40 PM
 */

#ifndef DATA_READER_H
#define DATA_READER_H

#include <stdio.h>
#include "json/json.h"

#include "Objects/CommandType.h"
#include "Objects/Command.h"
#include "Objects/Action.h"
#include "Objects/Rule.h"

#include "Objects/Model.h"

#include "Objects/DetailDef.h"
#include "Objects/Detail.h"
#include "Objects/RotorDef.h"
#include "Objects/Rotor.h"

#include "Objects/Link.h"

#include "Objects/CreatureDef.h"
#include "Objects/Creature.h"

#include "Objects/PlayerType.h"
#include "Objects/Player.h"

#include "Objects/Shape.h"
#include "Objects/Obstacle.h"
#include "Objects/Map.h"

#include "Objects/Camera.h"

#include "Objects/Scene.h"

namespace data {

	class Reader {
	public:
		Reader( );

		Json::Value ParseFile( std::string filename );

		const Scene* ReadScene( const Json::Value& value );
		
		const Camera* ReadCamera( const Json::Value& value );
		const Map* ReadMap( const Json::Value& value );
		const Obstacle* ReadObstacle( const Json::Value& value );
		const Shape* ReadShape( const Json::Value& value );
		
		Player ReadPlayer( const Json::Value& value );
		PlayerType ReadPlayerType( const Json::Value & value );
		
		const Creature* ReadCreature( const Json::Value & value );
		const CreatureDef* ReadCreatureDef( const Json::Value & value );
		const Detail* ReadDetail( const Json::Value & value );
		const DetailDef* ReadDetailDef( const Json::Value & value );
		const Model* ReadModel( const Json::Value & value );
		const Rotor* ReadRotor( const Json::Value & value );
		const RotorDef* ReadRotorDef( const Json::Value & value );
		Link ReadLink( const Json::Value & value );
		Rule ReadRule( const Json::Value & value );
		Command ReadCommand( const Json::Value & value );
		CommandType ParseCommandType( const Json::Value & value );
		Action ReadAction( const Json::Value & value );
		
		Circle ReadCircle( const Json::Value & value );
		Transform ReadTransform( const Json::Value & value );
		Vec2 ReadVec2( const Json::Value & value );

	};
}
#endif	/* READER_H */

